home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadcom / ads / sample / mkapps.nt < prev    next >
Encoding:
Text File  |  1995-02-08  |  5.4 KB  |  199 lines

  1. # mkapps.nt:   makefile for NT ADS application geomcal, util.obj, and
  2. #              saget.obj
  3. #
  4. # This makefile builds the ADS application, geomcal, in the current directory.
  5. #
  6. # Use the batch file, mkapps.bat to run this makefile.
  7. #
  8. # **************************** NOTE ***************************************
  9. #
  10. # BEFORE RUNNING THIS MAKEFILE, YOU MUST SET UP THE FOLLOWING
  11. # ENVIRONMENT VARIABLES IN MKAPPS.BAT:
  12. #
  13. # 1 - Make sure that your path includes NT MSVC++ bin directory so
  14. #     that the command line compiler, library manager, linker, and
  15. #     make utility can be found.
  16. #
  17. #     For example:
  18. #         path=e:\msvcnt\bin;c:\winnt\system32;c:\winnt
  19. #
  20. # 2 - Replace ADSINC's path with your path to the ADS include files 
  21. #     directory. For example:
  22. #
  23. #         set ADSINC=..
  24. #
  25. # 3 - Replace ADSLIB's path with your path to where the ADS kit files
  26. #     reside. For example:
  27. #
  28. #         set ADSLIB=..
  29. #
  30. # 4 - Make sure that the following environment variables exist. In the example
  31. #     below you would replace "e:" with the drive on which you have installed 
  32. #     MSVC++ for NT:
  33. #
  34. #    set Include=e:\msvcnt\include;e:\msvcnt\mfc\include;
  35. #    set Lib=e:\msvcnt\lib;e:\msvcnt\mfc\lib
  36. #
  37. # If you don't want to compile with debug info specify "NODEBUG=1" as a 
  38. # parameter to mkapps.bat, e.g., mkapps "NODEBUG=1"
  39. #
  40. # You may selectively build a module by specifying its name as
  41. # a parameter to mkapps.bat, e.g., mkapps saget
  42. #                              -or- mkapps saget "NODEBUG=1"
  43. #
  44. # *************************************************************************
  45. #
  46.  
  47. # *************************************************************************
  48. # If the environment variables have not been set, use the default
  49. # values below:
  50. # *************************************************************************
  51.  
  52. !IF "$(ADSINC)x" == "x"
  53. ADSINC=..
  54. !ENDIF
  55.  
  56. !IF "$(ADSLIB)x" == "x"
  57. ADSLIB=..
  58. !ENDIF
  59.  
  60. !include "$(MSVCDIR)\include\ntwin32.mak"
  61.  
  62. # *************************************************************************
  63. # "VPATH" specifies the path where you want your object/output files to go.
  64. # This includes ".obj", ".lib", ".exp", ".map", ".def", and ".dll" files.
  65. # By default, "VPATH" specifies the current directory.
  66. # *************************************************************************
  67.  
  68. VPATH=.
  69. ADSEXT=exe
  70. ads_lflags = $(guiflags)
  71. ads_llibs = $(guilibs)
  72.  
  73.  
  74. # *************************************************************************
  75. # "MAKEFILE" is the name of *this* makefile.
  76. # The name of this makefile is "mkapps.nt"
  77. # *************************************************************************
  78.  
  79. MAKEFILE = mkapps.nt
  80.  
  81. ADSXFLAGS = -nologo -I. -I$(ADSINC) -DWIN -DRADPACK
  82.  
  83. # ADS kit files
  84. ADSLIBR = $(ADSLIB)\winads.lib
  85.  
  86. ERRSTUFF = > $(@B).err 2>&1 && del $(@B).err || type $(@B).err
  87. # Uncomment the following line if you want to see compiler warnings
  88. # ERRSTUFF = > $(@B).err && type $(@B).err || type $(@B).err
  89.  
  90. # The cc, cflags, cvarsdll, and cdebug macros come from ntwin32.mak
  91. COMP = $(cc) $(cflags) $(cvarsdll) $(cdebug) \
  92.        -Fo$(VPATH)\ $(ADSXFLAGS)
  93.  
  94. # geomcal objects
  95. CALOBJS = \
  96.     $(VPATH)\cal.obj     \
  97.     $(VPATH)\calerr.obj  \
  98.     $(VPATH)\callex.obj  \
  99.     $(VPATH)\calexpr.obj \
  100.     $(VPATH)\calmngf.obj \
  101.     $(VPATH)\calstdf.obj \
  102.     $(VPATH)\calusrf.obj \
  103.     $(VPATH)\util.obj
  104.  
  105. .SUFFIXES: .c .obj
  106.  
  107. # Normal compile rule
  108. {.}.c{$(VPATH)}.obj:
  109.     echo Compiling $(@B).c
  110.     if exist $@ del $@
  111.     $(COMP) -Tc$(@B).c $(ERRSTUFF)
  112.  
  113.  
  114. all: \
  115.      $(VPATH)\geomcal.$(ADSEXT)  \
  116.      $(VPATH)\saget.obj    \
  117.      $(VPATH)\util.obj
  118.  
  119.  
  120. # Allow selective building.  Eg "mksamp saget".
  121. geomcal:  $(VPATH)\geomcal.$(ADSEXT)
  122. saget:    $(VPATH)\saget.obj
  123. util:     $(VPATH)\util.obj
  124.  
  125. # Link program(s).  Note: we just declare the dependencies
  126. # and let the built in rules handle things.
  127.  
  128. $(VPATH)\geomcal.exe: $(CALOBJS) \
  129.         $(ADSLIBR) $(MAKEFILE)
  130.     @echo Linking $@
  131.     $(MSVCDIR)\bin\link \
  132.         -map:$*.map \
  133.         -nodefaultlib \
  134.     $(ads_lflags) \
  135.     $(ads_llibs) \
  136.         $(ldebug) \
  137.     $(CALOBJS) $(ADSLIBR) \
  138.     -out:$@    \
  139.     $(ERRSTUFF)
  140.  
  141. $(VPATH)\geomcal.exp: $(MAKEFILE)
  142.     @echo Creating export library $@
  143.     @echo ^# Automatically generated $@ for NT dll building > $*.def
  144.     @echo LIBRARY $(@B) >> $*.def
  145.     $(MSVCDIR)\bin\lib \
  146.         -nologo \
  147.         -def:$*.def \
  148.         -machine:$(CPU) \
  149.         $(CALOBJS) $(ADSLIBR) \
  150.         -out:$*.lib \
  151.     $(ERRSTUFF)
  152.  
  153. $(VPATH)\geomcal.dll: $(CALOBJS) $(VPATH)\$(@B).exp \
  154.         $(ADSLIBR) $(MAKEFILE)
  155.     @echo Linking $@
  156.     $(MSVCDIR)\bin\link \
  157.         -dll \
  158.         -base:0x20100000 \
  159.         -map:$*.map \
  160.         -nodefaultlib \
  161.     $*.exp \
  162.     $(ads_lflags) \
  163.     $(ads_llibs) \
  164.         $(ldebug) \
  165.     $(CALOBJS) $(ADSLIBR) \
  166.     -out:$@    \
  167.     $(ERRSTUFF)
  168.  
  169. {$(VPATH)}.obj{$(VPATH)}.exp:
  170.     @echo Creating export library $@
  171.     @echo ^# Automatically generated $@ for NT dll building > $*.def
  172.     @echo LIBRARY $(@B) >> $*.def
  173.     $(MSVCDIR)\bin\lib \
  174.         -nologo \
  175.         -def:$*.def \
  176.         -machine:$(CPU) \
  177.         $*.obj $(ADSLIBR) \
  178.         -out:$*.lib \
  179.     $(ERRSTUFF)
  180.  
  181. # ADS program executeable
  182.  
  183. {$(VPATH)}.obj{$(VPATH)}.dll:
  184.     @echo Linking $@
  185.     $(MSVCDIR)\bin\link \
  186.         -dll \
  187.         -base:0x20100000 \
  188.         -map:$*.map \
  189.         -nodefaultlib \
  190.     $*.exp \
  191.     $(ads_lflags) \
  192.     $(ads_llibs) \
  193.         $(ldebug) \
  194.     $*.obj $(ADSLIBR) \
  195.     -out:$@    \
  196.     $(ERRSTUFF)
  197.  
  198.  
  199.